1 REM       Program:     SETCLOCK
2 REM       Author:      Gerald M. Vrooman
3 REM       Language:    GWBASIC
4 REM
10 REM This program can be used to set  the real time clock  on an  XT
11 REM clock card using the folowing port addresses:
12 REM
13 REM            &h242      Seconds
14 REM            &h243      Minutes
15 REM            &h244      Hour
16 REM            &h246      Day
17 REM            &h247      Month
18 REM            &h249      Year
19  REM For clock cards having different port addresses, the new addresses
20 REM can be substituted in  line  150 and 160.
21 REM
50 CLS
69 REM
70 INPUT "enter last two digits of year";N
71 GOSUB 500
72 YR = NB
79 REM
80 INPUT "enter month";N
81 GOSUB 500
82 MO=NB
89 REM
90 INPUT "enter day";N
91 GOSUB 500
92 DA=NB
99 REM
100 INPUT "enter hour";N
101 GOSUB 500
102 HO=NB
109 REM
110 INPUT "enter minute";N
111 GOSUB 500
112 MI=NB
119 REM
120 INPUT "enter second";N
121 GOSUB 500
122 SE=NB
145 REM
146 REM use out  function to set date and time on card
147 REM
149 OUT &H249,YR
150 OUT &H247,MO : OUT &H246,DA
160 OUT &H244,HO : OUT &H243,MI : OUT &H242,SE
170 REM
200 CLS : PRINT "CLOCK IS NOW SET. RUN GETCLOCK.BAS TO SET  DOS TIME AND DATE"
499 END
500 REM convert number to  bcd
510 IF N=0 THEN H%=0  ELSE H% = (N/10) - .5
511 H = H% * 16
512 L = N - (H% * 10)
513 NB = H + L
515 RETURN
